import Vue from 'vue'
import Router from 'vue-router'
import Login from "../components/Login.vue";
import Register from "../components/Register.vue";
import Index from "../components/Index.vue";
import Predict from "../components/Predict.vue";
import History from "../components/History.vue";
import Home from "../components/Home.vue";
import User from "../components/User.vue";


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    {
      path: '/index',
      name: 'index',
      component: Index,
      children: [
        {
          path: 'home',
          name: 'home',
          component: Home
        },
        {
          path: 'history',
          name: 'history',
          component: History
        },
        {
          path: 'predict',
          name: 'predict',
          component: Predict
        },
        {
          path: 'user',
          name: 'user',
          component: User
        },

        ]
    },
  ]
})
